<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="/basecore/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<%@ include file="/basecore/meta.jsp"%>
</head>
<body>
<script>
function testHandler(){
	alert("handler");
}
function doOnClick(nodeId) {
    var data = demoTree.getUserData(nodeId, "others");
    alert(data);
}
function onNodeSelect(nodeId){
	alert(nodeId);
}
function getUserData() {
    var id = demoTree.getSelectedItemId();
    var da = demoTree.getUserData(id, "others");
    alert(da);
    return da;
}
function hasChildren(){
	var id = demoTree.getSelectedItemId();
	return demoTree.hasChildren(id);
}
function getSelectedItemId() {
    return demoTree.getSelectedItemId();
}
function getSelectedItemText() {
    return demoTree.getSelectedItemText();
}
function test(){
	demoTree.enableTreeLines(true);
	demoTree.enableMultiLineItems(true);
	demoTree.enableKeyboardNavigation(true);
	demoTree.enableSmartXMLParsing(true);//false to disable
	demoTree.enableThreeStateCheckboxes(true)//false to disable
}
</script>
选择树演示1
<table>
<tr><td>
<div id="demoTreeBox" style="width:400"></div>
<wit:tree treeBox="demoTreeBox" rootId="0"
	theme="csh_winstyle" data="select id,name from c_category_code" nodeid="id" nodelabel="name"
	data2="select id,name from c_category" nodeid2="id" nodelabel2="name"  parentid="parent_id"
	datatype="sql" others="type_code"
	onClickHandler="doOnClick" name="demoTree"/>

<script>

</script>
<td></td><td align=left valign="top">
<div style="width:200; height: 60">
<input type="button" onclick="alert(getSelectedItemText());" value="getSelectedItemText">
<input type="button" onclick="alert(getSelectedItemId());" value="getSelectedItemId">
<input type="button" onclick="alert(hasChildren());" value="hasChildren">
<input type="button" onclick="alert(getUserData());" value="getUserData">
</div>
</td></tr>
</table>
</body>
</html>
